<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('钉钉产码')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<div style="color: red;font-size: 20px;">一天只能产码30次,请分配好码</div>
        <form class="form-horizontal m" id="form-channelCode-add">
			<div class="form-group">
				<label class="col-sm-3 control-label">钉钉主号id：</label>
				<div class="col-sm-5">
					<select style="width: 100%;height: 36px; border: 1px solid #ddd;" name="masterId" required>
						<option th:each="accountInfo,userStat:${accountInfos}" th:value="${accountInfo.appid}" th:text="${accountInfo.account}"></option>
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">金额(100-5000)：</label>
				<div class="col-sm-8">
					<input id="amount" name="amount" class="form-control" type="text" placeholder="建议输入整百数,根据订单百分比分配码数">
				</div>
			</div>

		</form>
	</div>
    <div th:include="include::footer"></div>
    <script type="text/javascript">
		var prefix = ctx + "channel/channelCode"
		$("#form-channelCode-add").validate({
			rules:{
				masterId:{
					required:true,
				},
				amount:{
					required:true,
				},
			},
			focusCleanup: true
		});
		
		function submitHandler() {
	        if ($.validate.form()) {
	            $.operate.save(prefix + "/add", $('#form-channelCode-add').serialize());
	        }
	    }
	</script>
</body>
</html>
